class TextBook extends Book {
    private String subject;

    public TextBook(String name, String author, double price, String subject) {
        super(name, author, price);
        this.subject = subject;
    }

    @Override
    public double getPrice() {
        return super.getPrice() * 0.8;
    }

    @Override
    public String toString() {
        return "教科书《" + getName() + "》，作者：" + getAuthor() + "，科目：" + subject + "，折后价格：" + getPrice() + "元";
    }
}